<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div>
    <el-form ref="form" :model="s_search" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 搜索 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="24">
            <el-form-item label="供应商类型" prop="client_class">
              <el-select style='width:100%' v-model="s_search.client_class">
                <el-option label="全部" value="-1" />
                <el-option label="组织" value="'组织'" />
                <el-option label="个人" value="'个人'" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="供应商名称" prop="client_name">
              <el-input v-model="s_search.client_name" />
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <el-button @click="('')" type='success' size="mini"><i class='fa fa-check'></i>搜索</el-button>
      <el-button @click="$parent.$parent.popSupplierChoice('')" type='primary' size="mini">重置</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 供应商 </span>
      </div>
      <el-table :data="p_message">
        <el-table-column label="" prop="client_id" width="80">
          <template slot-scope="scope">
            <el-button @click="$parent.$parent.closeSupplierChoice(scope.row['client_id'],scope.row['client_name']);" type="success" size="mini"><i class="fa fa-edit"></i>选择</el-button>
          </template>
        </el-table-column>
        <el-table-column label="供应商条形码" prop="client_barcode">
        </el-table-column>
        <el-table-column label="类型" prop="client_class">
        </el-table-column>
        <el-table-column label="名称" prop="client_id">
          <template slot-scope="scope">
            <el-link @click="gotoPage('/psi/supplychainmana/SupplierDetil?CMID='+scope.row.client_id+''+vueparams+'')" type='primary'>{{scope.row.client_name}}</el-link>
          </template>
        </el-table-column>
        <el-table-column label="网站地址" prop="client_net">
        </el-table-column>
        <el-table-column label="录入时间" prop="client_entime">
        </el-table-column>
      </el-table>
      <pagination v-show="total>0" :total="total" :limit.sync="pageSize" @pagination="getPage" />
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'SupplierChoice',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        s_search: {
          client_class: null,
          client_name: null,
        },
        p_message: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/supplychainmana/StorageAction/supplierChoice?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
    },
  }
</script>
